{
 "metadata": {
  "name": "",
  "signature": "sha256:2f7a72cbc8c7a4f9909a0ab9a42a77c3b1259c4fbbbcc4e2dfb3324fdfe6ab7e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%matplotlib inline\n",
      "import numpy as np\n",
      "import matplotlib.pyplot as plt\n",
      "import sys\n",
      "from sklearn.datasets import load_files\n",
      "from sklearn.cross_validation import train_test_split"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Dataset collection (from Wikipedia)"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "dataset = load_files('language/paragraphs')\n",
      "docs_train, docs_test, y_train, y_test = train_test_split(\n",
      "    dataset.data, dataset.target, test_size=0.5, random_state=0)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 20
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "for example, lang_code in list(zip(docs_train, y_train))[:3]:\n",
      "    print(example.decode('utf-8'))\n",
      "    print(\"=> %s\\n\" % dataset.target_names[lang_code])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "In 2005 publiceerde het natuurwetenschappelijke tijdschrift Nature de resultaten van een vergelijkend onderzoek naar de kwaliteit van artikelen in de Engelse Wikipedia (WP) en de Encyclop\u00e6dia Britannica.[18] Universitaire deskundigen bogen zich over natuurwetenschappelijke teksten, zonder te weten uit welke encyclopedie ze kwamen. In 42 paren van overeenkomstige artikelen uit beide encyclopedie\u00ebn vonden ze zowel in WP als in EB totaal acht ernstige fouten. Gemiddeld bevatte een WP-artikel vier en een EB-artikel drie foutjes, weglatingen of misleidende beweringen. Nature concludeerde dat hoewel de schrijfstijl van de Brittanica veel beter was, de Wikipedia op natuurwetenschappelijk gebied bijna net zo goed was als de Britannica. Orlowski formuleerde het als volgt: de kwaliteit van informatie in deze artikelen was in Wikipedia daarmee 31 procent minder dan in de Britannica.[19] Het betrof hier een betrekkelijk kleine selectie van artikelen over exacte wetenschappen en techniek, en veel van de aangetroffen 'fouten' betroffen meningsverschillen tussen de onderzoekers van Nature en de redacteuren van de Britannica over welke feiten vermeld zouden moeten worden in een encyclopedie.[20] In maart 2006 publiceerde de Encyclop\u00e6dia Britannica onder de titel \"Fatally Flawed\" een weerlegging van de onderzoeksresultaten van Nature.[21]\n",
        "=> nl\n",
        "\n",
        "Il existe \u00e9galement un classement qualitatif fond\u00e9 sur l'existence et la taille des articles d'une liste arbitraire d'environ 1\u00a0000 articles que toute \u00e9dition de Wikip\u00e9dia devrait avoir[note 18].\n",
        "=> fr\n",
        "\n",
        "On January 18, 2012, the English Wikipedia participated in a series of coordinated protests against two proposed laws in the United States Congress\u2014the Stop Online Piracy Act (SOPA) and the PROTECT IP Act (PIPA)\u2014by blacking out its pages for 24 hours.[144] More than 162 million people viewed the blackout explanation page that temporarily replaced Wikipedia content.[145][146]\n",
        "=> en\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Model fitting"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sklearn.feature_extraction.text import TfidfVectorizer\n",
      "from sklearn.linear_model import Perceptron\n",
      "from sklearn.pipeline import make_pipeline\n",
      "\n",
      "vectorizer = TfidfVectorizer(ngram_range=(1, 3), analyzer='char',\n",
      "                             use_idf=False)\n",
      "\n",
      "clf = make_pipeline(vectorizer, Perceptron())\n",
      "clf.fit(docs_train, y_train);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Model evaluation"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "sentences = [\n",
      "    \"This is a language detection test.\",\n",
      "    \"Ceci est un test de d\u00e9tection de la langue.\",\n",
      "    \"Das ist eine Spracherkennungstest.\",\n",
      "    \"Je suis au S\u00e9nat pour pr\u00e9senter l'analyse pr\u00e9dictive de donn\u00e9es.\"\n",
      "]\n",
      "predicted = clf.predict(sentences)\n",
      "\n",
      "for s, p in zip(sentences, predicted):\n",
      "    print(u'The language of \"%s\" is \"%s\"' % (s, dataset.target_names[p]))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The language of \"This is a language detection test.\" is \"en\"\n",
        "The language of \"Ceci est un test de d\u00e9tection de la langue.\" is \"fr\"\n",
        "The language of \"Das ist eine Spracherkennungstest.\" is \"de\"\n",
        "The language of \"Je suis au S\u00e9nat pour pr\u00e9senter l'analyse pr\u00e9dictive de donn\u00e9es.\" is \"fr\"\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sklearn.metrics import classification_report\n",
      "\n",
      "y_predicted = clf.predict(docs_test)\n",
      "print(classification_report(y_test, y_predicted,\n",
      "                            target_names=dataset.target_names))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "             precision    recall  f1-score   support\n",
        "\n",
        "         ar       1.00      1.00      1.00        14\n",
        "         de       0.98      1.00      0.99        47\n",
        "         en       1.00      1.00      1.00        77\n",
        "         es       1.00      1.00      1.00        45\n",
        "         fr       1.00      0.98      0.99        59\n",
        "         it       0.98      1.00      0.99        45\n",
        "         ja       1.00      0.97      0.99        35\n",
        "         nl       1.00      1.00      1.00        18\n",
        "         pl       1.00      0.95      0.97        20\n",
        "         pt       0.98      1.00      0.99        47\n",
        "         ru       1.00      1.00      1.00        26\n",
        "\n",
        "avg / total       0.99      0.99      0.99       433\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sklearn.decomposition import TruncatedSVD\n",
      "from itertools import cycle\n",
      "\n",
      "\n",
      "X_train = vectorizer.fit_transform(docs_train)\n",
      "X_pca = TruncatedSVD(50).fit_transform(X_train)\n",
      "\n",
      "for i, c in zip(np.unique(y_train)[:5],\n",
      "                cycle(['r', 'g', 'b', 'c', 'm', 'y'])):\n",
      "    mask = y_train == i\n",
      "    language = dataset.target_names[i]\n",
      "    plt.scatter(X_pca[mask, 0], X_pca[mask, 1], color=c, label=language)\n",
      "    \n",
      "plt.legend(loc='best');"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEACAYAAABI5zaHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4lOW9//H3PQmQsAQSUBAcEQQVDSJLUKTWFCSxeIlS\nRbBaty500eOpOedXFUWEQ2k9J7081f56qQe05Yj08LNQpepAPYKH4xaCpAYXiGgMsmgYVrNn7t8f\nz0xmySSZMFknn9d1zcU8yzzPPQ/wzZ3vvRlrLSIiklhcnV0AERFpewruIiIJSMFdRCQBKbiLiCQg\nBXcRkQSk4C4ikoDiDu7GmKuMMR8ZY/YYY34R5fi1xpgiY8x7xphCY8yMeO8pIiLNM/H0czfGJAEf\nA1cCXwAFwE3W2g9Dzulnrf3a/348sN5aOyauUouISLPirblPBUqstZ9Za2uBtcC1oScEArtff6A8\nznuKiEgL4g3uI4CykO19/n1hjDHXGWM+BF4B/iHOe4qISAviDe4x5XSstRusteOAa4DVcd5TRERa\nkBzn578A3CHbbpzae1TW2v8xxiQbYwZbaw+HHjPGaJIbEZFWstaaaPvjrblvB8YaY842xvQG5gMv\nhp5gjDnHGGP87yf5C3O40ZWc/Xq18Hr44Yc7vQzd4aXnpGfVE55Tc+KquVtr64wxdwEeIAlYaa39\n0Biz0H/8SeB64FZjTC1wElgQzz1FRKRl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St\n/cgY8yrOQDofzgC7HhXcY/z39EvgGWNMEU6l7/9Ya72dVuhOYox5HrgCGGKMKQMexkntBf49vWyM\nmW2MKQG+Bu7ovNI2T4OYREQSkJbZExFJQAruIiIJSMFdRCQBKbiLiCQgBXcRkQSk4C4ikoAU3EVE\nEpCCu4hIAvr/eZkdM74bzcEAAAAASUVORK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x109550160>"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}